package com.yuyou.tas.lesson.service;


import com.yuyou.tas.lesson.vo.req.ReqAddBaseChapter;
import com.yuyou.tas.lesson.vo.req.ReqUpdateBaseChapter;
import com.yuyou.tas.service.api.lesson.dto.DtoBaseChapter;
import com.yuyou.tas.service.api.lesson.entity.BaseChapter;
import com.yuyou.tas.util.bean.LoginRedisObj;
import com.yuyou.tas.util.bean.Pagination;
import com.yuyou.tas.util.bean.ResBoolSimpleInfo;

import java.util.List;


public interface IBaseChapterService {
    BaseChapter selectByPrimaryKey(Long id);
    
    List<BaseChapter> selectByPrimaryKeys(List<Long> ids);
    
    ResBoolSimpleInfo<String> addChapter(ReqAddBaseChapter chapter,Long pId,Long lectureId,Integer isStan, LoginRedisObj user,Long organId);
    ResBoolSimpleInfo<String> updateChapter(ReqUpdateBaseChapter chapter,Long pId, Long lectureId, Integer isStan, LoginRedisObj user) throws Exception;
    ResBoolSimpleInfo<String> delChapter(Long id) throws Exception;
    ResBoolSimpleInfo<BaseChapter> getChapterByID(Long id);

    int findChapterCount(Pagination<DtoBaseChapter> queryPgn);
    List<DtoBaseChapter> findChapterPageList(Pagination<DtoBaseChapter> queryPgn);

    BaseChapter selectByPKandOrgan(Long id, Long authOrganizationId);

    Integer findByResourceId(String resourceId);
    
    /**
     * 根据lectureUrl查出唯一BaseChapter
     * @param lectureUrl
     * @return
     */
    BaseChapter selectByLectureUrl(String lectureUrl);
    
    /**
     * 根据courseUrl查出唯一BaseChapter
     * @param lectureUrl
     * @return
     */
    BaseChapter selectByCourseUrl(String courseUrl);
    
    /**
     * 根据lessonClassId和lectureUrl查出唯一BaseChapter
     * @param lessonClassId
     * @param lectureUrl
     * @return
     */
    BaseChapter selectByCla7LectureUrl(Long lessonClassId,String lectureUrl);
    
    /**
     * 根据lessonClassId和courseUrl查出唯一BaseChapter
     * @param lessonClassId
     * @param courseUrl
     * @return
     */
    BaseChapter selectByCla7CourseUrl(Long lessonClassId,String courseUrl);
    
}